package org.sdp.pearproject.dto.convert;

import org.sdp.pearproject.dao.domain.*;
import org.sdp.pearproject.dto.request.*;
import java.util.Date;

/**
 * @ClassName: OrganizationAddRequestConvert
 * @Description:
 * @Author: SDP
 * @Date: 2022-07-04
 * @Version: 1.0
 * Table: pear_organization
 * Comment:
 * 组织表
 */
public class OrganizationAddRequestConvert extends BaseConvert {
    public static OrganizationWithBLOBs convert(OrganizationAddRequest request) throws Exception {
        OrganizationWithBLOBs daoRequest = new OrganizationWithBLOBs();
        copyProperties(request, daoRequest);

        daoRequest.setName(daoRequest.getName() == null ? null : daoRequest.getName().trim());
        daoRequest.setAvatar(daoRequest.getAvatar() == null ? null : daoRequest.getAvatar().trim());
        daoRequest.setDescription(daoRequest.getDescription() == null ? null : daoRequest.getDescription().trim());
        daoRequest.setOwnerCode(daoRequest.getOwnerCode() == null ? null : daoRequest.getOwnerCode().trim());
        daoRequest.setCode(daoRequest.getCode() == null ? null : daoRequest.getCode().trim());
        daoRequest.setAddress(daoRequest.getAddress() == null ? null : daoRequest.getAddress().trim());

        return daoRequest;
    }
}
